
__version__ = '$Rev: 29 $'

import os
import settings

__all__ = ['backends']

if settings.TEST_DEVICE:
    from backends.test import ScannerCollection
elif os.name == 'posix':
    from backends.sane import ScannerCollection
elif os.name == 'nt':
    from backends.twain import ScannerCollection
else:
    #TODO: Log error
    raise Exception('OS not supported')

__scanners__ = ScannerCollection()

def list():
    return __scanners__.list()

def get(id):
    return __scanners__.get(id)

